/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package regras;

import Interfaces.CheckerRule;

/**
 *
 * @author Tainá, Ana Luiza e Amanda
 */
public class RuleSymbols02 implements CheckerRule{
     private String password;
    public RuleSymbols02(String password) {
        this.password = password;
    }
    
    @Override
    public int rule(){
        int total = 0;
        int symbol = 0;
        char[] pwd = password.replaceAll("\\s+", "").toCharArray(); 
        for (int i=0; i<pwd.length; i++){
             if ((!Character.isDigit(pwd[i]) && !Character.isLetter(pwd[i]) && pwd[i] != '_')){
                 symbol++;
             }
        }
        
        if (symbol > 0)
           total += symbol * 6;
        return total;
    }    
}
